package edu.suda.entity;

import lombok.*;

import java.util.Set;

/*********************
 * @Author: 苏大
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder    // Product.builder().id(1).name("张三").toBuild()
public class Product {

    private Integer id;
    private String name;
    @NonNull
    private String title;
    private String description;
    /** 单价 */
    @NonNull
    private Double price;
    /** 折扣价 */
    private Double discountPrice;
    private Integer stock;
    private Integer count;
    private String url;

    /** 包含0个或多个Gift */
    @EqualsAndHashCode.Exclude
    @ToString.Exclude
    private Set<Gift> gifts;

    /** 如果要做双向关联，则此处添加 Company属性*/
    @ToString.Exclude
    @EqualsAndHashCode.Exclude
    private Company company;

}
